<template>
  <div>
    <account-login :ruleForm="accountForm" :rules='accountRules'
     @submit='submit' @errHandle='errHandle'>

    </account-login>
  </div>
</template>

<script>
// import accountLogin from '../components/accountlogin/accountLogin.vue'
export default {
  name:'login',
  // components: {
  //    accountLogin 
  //    },
  data(){
    return{
      accountForm:{
        username:'',
        password:''

      },
      accountRules:{
        username:[
          {
            required:true,
            message:'用户名不能为空',
            trigger:'blur'
          },
          {
            min:2,
            max:6,
            message:'用户在2-6字符之间',
            trigger:'blur'
          }
         
        ],
         password:[
            {   
            required:true,
            message:'密码不能为空',
            trigger:'blur'
            },
             {
            min:6,
            max:15,
            message:'密码在6-15字符之间',
            trigger:'blur'
          }
          ]
      }
    }
  },
  methods:{
    submit(){
      this.$message.success('提交成功')


    },
    errHandle(){
      this.$message.error('填写有误请检查')

    }
  }
  

}
</script>

<style>

</style>